Skip to content

Fixes for 2plane2chan tests while running on non-Linux operating systems - #1278

Open
joannercsheppard wants to merge 1 commit into
MouseLand:mainfrom
joannercsheppard:fix-detection-test-tolerance
Open

joannercsheppard wants to merge 1 commit into
MouseLand:mainfrom
joannercsheppard:fix-detection-test-tolerance

Conversation

@joannercsheppard

Copy link
Copy Markdown

While running tests for PR #1255 2plane2chan test_detection_output_2plane2chan fails on Windows due to discrepancies between the ROI shapes. On further inspection, this test does not use temporal_smoothing (the bug #1255 is fixing), and also fails on main. This PR makes detection regression tests tolerant of cross-platform differences.

Detection is not bit-identical across platforms (BLAS / float32 summation order), so pixels near the ROI threshold can flip. On macOS and Windows, one ROI in test_detection_output_2plane2chan loses 4 edge pixels, which also changes its neighbour's cell mask, and the exact np.allclose comparison fails on the shape mismatch (178 vs 176 pixels).

Both detection tests (for 1plane1chan and 2plane2chan) now use DetectionTestUtils.check_output, which requires:

  • the same number of ROIs as the reference
  • at least 90% of ROIs to match exactly (previous comparison)
  • every ROI to overlap its reference with IoU >= 0.9 (stat pixels,
    cell mask, neuropil mask)

…or discrepancies in ROIs found in different operating systems

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant